package com.vitabuybuy.tv.dto;

import com.vitabuybuy.tv.utils.LanaugeUtils;

/**
 * 作者：SimGa
 * 日期：2021/1/12
 * 时间：16:07
 * 包名：com.vitabuybuy.tv.dto
 */
public class MyGroupBuyDetailDto {

    /**
     * thumbnail : http://106.55.47.138/attachment/jpg/1359/759_13779.jpg
     * originalPrice : 150.0
     * promotionPrice : 99.0
     * name : {"EN":"nikedunk","CN":"nikedunk","MA":"nikedunk"}
     * id : 61
     * store : {"name":"李艺科潮男装卖店","logo":"http://106.55.47.138/attachment/jpg/4052/793_15950.jpg","id":12}
     */

    private ProductBean product;
    private String expireTime;
    private Integer memberQuantity;
    private String createTime;
    private Integer orderId;
    private Integer id;
    private String type;
    private String status;
    private Integer memberLimit;
    private Integer totalQuantity;

    private PurchasingGroupBean purchasingGroup;

    public Integer getOrderId() {
        return orderId;
    }

    public void setOrderId(Integer orderId) {
        this.orderId = orderId;
    }

    public Integer getTotalQuantity() {
        if (totalQuantity == null) {
            return purchasingGroup.totalQuantity;
        }
        return totalQuantity;
    }

    public void setTotalQuantity(Integer totalQuantity) {
        this.totalQuantity = totalQuantity;
    }

    public PurchasingGroupBean getPurchasingGroup() {
        if(purchasingGroup == null){
            purchasingGroup = new PurchasingGroupBean();
        }
        return purchasingGroup;
    }

    public void setPurchasingGroup(PurchasingGroupBean purchasingGroup) {
        this.purchasingGroup = purchasingGroup;
    }

    public ProductBean getProduct() {
        if (product == null) {
            product = purchasingGroup.getProduct();
        }
        return product;
    }

    public void setProduct(ProductBean product) {
        this.product = product;
    }

    public String getExpireTime() {
        if (expireTime == null) {
            return purchasingGroup.expireTime;
        }
        return expireTime;
    }

    public void setExpireTime(String expireTime) {
        this.expireTime = expireTime;
    }

    public Integer getMemberQuantity() {
        if (memberQuantity == null)
            return purchasingGroup.memberQuantity;
        return memberQuantity;
    }

    public void setMemberQuantity(Integer memberQuantity) {
        this.memberQuantity = memberQuantity;
    }

    public String getCreateTime() {
        if (createTime == null) {
            return purchasingGroup.createTime;
        }
        return createTime;
    }

    public void setCreateTime(String createTime) {
        this.createTime = createTime;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getType() {
        if (type == null) {
            return purchasingGroup.type;
        }
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public String getStatus() {
        if (status == null) {
            return purchasingGroup.status;
        }
        return status;
    }

    public void setStatus(String status) {
        this.status = status;
    }

    public Integer getMemberLimit() {
        if (memberLimit == null) {
            return purchasingGroup.memberLimit;
        }
        return memberLimit;
    }

    public void setMemberLimit(Integer memberLimit) {
        this.memberLimit = memberLimit;
    }


    public static class PurchasingGroupBean {
        private Integer gainQuantity = 0;
        private Integer memberQuantity = 0;
        private ProductBean product;
        private String expireTime;
        private String createTime;
        private Integer id = 0;
        private String type;
        private String status;
        private Integer memberLimit = 0;
        private Integer totalQuantity = 0;
        private Integer orderId;

        public Integer getOrderId() {
            return orderId;
        }

        public void setOrderId(Integer orderId) {
            this.orderId = orderId;
        }

        public Integer getMemberQuantity() {
            return memberQuantity;
        }

        public void setMemberQuantity(Integer memberQuantity) {
            this.memberQuantity = memberQuantity;
        }

        public String getExpireTime() {
            return expireTime;
        }

        public void setExpireTime(String expireTime) {
            this.expireTime = expireTime;
        }

        public String getCreateTime() {
            return createTime;
        }

        public void setCreateTime(String createTime) {
            this.createTime = createTime;
        }

        public Integer getId() {
            return id;
        }

        public void setId(Integer id) {
            this.id = id;
        }

        public String getType() {
            return type;
        }

        public void setType(String type) {
            this.type = type;
        }

        public String getStatus() {
            return status;
        }

        public void setStatus(String status) {
            this.status = status;
        }

        public Integer getMemberLimit() {
            return memberLimit;
        }

        public void setMemberLimit(Integer memberLimit) {
            this.memberLimit = memberLimit;
        }

        public Integer getTotalQuantity() {
            return totalQuantity;
        }

        public void setTotalQuantity(Integer totalQuantity) {
            this.totalQuantity = totalQuantity;
        }

        public Integer getGainQuantity() {
            return gainQuantity;
        }

        public void setGainQuantity(Integer gainQuantity) {
            this.gainQuantity = gainQuantity;
        }

        public ProductBean getProduct() {
            return product;
        }

        public void setProduct(ProductBean product) {
            this.product = product;
        }
    }

    public static class ProductBean {
        private String thumbnail;
        private double originalPrice;
        private double promotionPrice;
        private String name;
        private Integer id = 0;
        /**
         * name : 李艺科潮男装卖店
         * logo : http://106.55.47.138/attachment/jpg/4052/793_15950.jpg
         * id : 12
         */

        private StoreBean store;

        public String getThumbnail() {
            return thumbnail;
        }

        public void setThumbnail(String thumbnail) {
            this.thumbnail = thumbnail;
        }

        public double getOriginalPrice() {
            return originalPrice;
        }

        public void setOriginalPrice(double originalPrice) {
            this.originalPrice = originalPrice;
        }

        public double getPromotionPrice() {
            return promotionPrice;
        }

        public void setPromotionPrice(double promotionPrice) {
            this.promotionPrice = promotionPrice;
        }

        public String getName() {
            return LanaugeUtils.returnStrByLocation(name);
        }

        public void setName(String name) {
            this.name = name;
        }

        public Integer getId() {
            return id;
        }

        public void setId(Integer id) {
            this.id = id;
        }

        public StoreBean getStore() {
            return store;
        }

        public void setStore(StoreBean store) {
            this.store = store;
        }

        public static class StoreBean {
            private String name;
            private String logo;
            private Integer id;

            public String getName() {
                return name;
            }

            public void setName(String name) {
                this.name = name;
            }

            public String getLogo() {
                return logo;
            }

            public void setLogo(String logo) {
                this.logo = logo;
            }

            public Integer getId() {
                return id;
            }

            public void setId(Integer id) {
                this.id = id;
            }
        }
    }
}
